package com.alex.cms.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alex.cms.dao.CmsArticleMapper;
import com.alex.cms.domain.CmsArticle;
import com.alex.cms.service.ICmsArticleService;
import com.alex.cms.web.vo.ArticleVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * <p>
 * 文章内容表 服务实现类
 * </p>
 *
 * @author alex
 * @since 2019-09-11
 */
@Service
public class CmsArticleServiceImpl extends ServiceImpl<CmsArticleMapper, CmsArticle> implements ICmsArticleService {
	//分页获取所有的文章
	@Override
	public IPage<ArticleVo> selectAllArticlesByUserId(IPage<ArticleVo> page, QueryWrapper<ArticleVo> queryWrapper) {
		return this.baseMapper.selectAllArticlesByUserId(page, queryWrapper);
	}

	@Override
	public List<ArticleVo> selectAllArticlesByUserId(QueryWrapper<ArticleVo> queryWrapper) {
		
		return this.baseMapper.selectAllArticlesByUserId(queryWrapper);
	}
	//分页查询点击率排行榜
	@Override
	public List<CmsArticle> selectAllArticlesByHits(IPage<CmsArticle> page, QueryWrapper<CmsArticle> queryWrapper) {
		return this.baseMapper.selectAllArticlesByHits(page, queryWrapper);
	}

}
